<?php
include "header.php";

?>

    <div class="container-fluid">

        <div class="col-sm-12  col-md-12  main" style="margin-top: 100px;">
        		<div class="row">
	        		<div class="col-md-2" >
		         <div align="center">
		         	<img src="assets/img/yuanjiao/homepen.png" width="150" height="150" data-toggle="modal" data-target="#myModal"/>
		         </div>
		         <div align="center">
		         	General评估表
		         </div>
		        </div>
		        
		        
		    </div>
		   

<!-- 模态框（Modal） -->
<div id="myModal" class="modal fade " tabindex="-1" role="dialog" aria-labelledby="modalTitle" aria-hidden="true" data-keyboard="false" data-backdrop="static">
    <div class="modal-dialog" style="width:90%;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="modalTitle">
                    General 评估表
                </h4>
            </div>
            <div class="modal-body" style="min-height: 300px;max-height: 400px;overflow-y:auto;padding: 10px 5%;">
                <div><input></div>
                <div><input></div>
            </div>
            <div class="modal-footer" id='button3_group'>
                <button type='button' id="ppage" data-loading-text="加载中" class='btn btn-primary previous-page hidden'>
                    上一页
                </button>
                <button type="button" id="npage" data-loading-text="加载中" class="btn btn-primary next-page">
                    下一页
                </button>
                <button type="button"  class="btn btn-default" data-dismiss="modal" onClick="doInitVar()">
                    取消
                </button>
                <label class="page-index" hidden>0</label>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
		   
        </div>
    </div>


    <script>
    		// global vars
    		
    		var queueArr=new Array();
    		
    		var dataArr=new Array();
    		
    		function doInitVar()
    		{
    			dataArr[0]= new Object();
	    		dataArr[0].companyname="<?php echo $_COOKIE['companyname'];?>";
	    		dataArr[0].emailname="<?php echo $_COOKIE['emailname'];?>";
	    		dataArr[0].currdate="<?php echo date("d/m/Y");?>";
	    		dataArr[0].customername="";
	    		dataArr[0].brithday="01/01/1980";
	    		dataArr[0].age="99";
	
	    		
	    		dataArr[1]= new Object();
	    		dataArr[1].companyname1="";
	    		dataArr[1].scopeofb1="";
	    		dataArr[1].yourproportion1="0";
	    		dataArr[1].spouseproportion1="0";
	    		dataArr[1].establishtime1="01/01/1980";
	    		
	    		dataArr[1].companyname2="";
	    		dataArr[1].scopeofb2="";
	    		dataArr[1].yourproportion2="0";
	    		dataArr[1].spouseproportion2="0";
	    		dataArr[1].establishtime2="01/01/1980";
	    		
	    		
	    		dataArr[2]=new Object();
	    		dataArr[2].spousechangeproportion="否";
	    		dataArr[2].spousechangeproportion_txt="否";
	    		dataArr[2].spousechangeproportioninfo="";
	    		
	    		dataArr[3]=new Object();
	    		dataArr[3].company1turnover1="0";
	    		dataArr[3].company1turnover2="0";
	    		dataArr[3].company1turnover3="0";
	    		dataArr[3].company1turnover4="0";
	    		dataArr[3].company2turnover1="0";
	    		dataArr[3].company2turnover2="0";
	    		dataArr[3].company2turnover3="0";
	    		dataArr[3].company2turnover4="0";
	    		
	    		dataArr[3].positions2014="a";
	    		dataArr[3].positions2015="a";
	    		dataArr[3].positions2016="a";
	    		dataArr[3].positions2017="a";
	    		
	    		
	    		dataArr[3].companyturnover1="0";
	    		dataArr[3].companyturnover2="0";
	    		dataArr[3].companyturnover3="0";
	    		dataArr[3].companyturnover4="0";
	    		
	    		dataArr[3].positions2014="c";
	    		dataArr[3].positions2015="c";
	    		dataArr[3].positions2016="c";
	    		dataArr[3].positions2017="c";
	    		dataArr[3].positions2014_txt="都不符合";
	    		dataArr[3].positions2015_txt="都不符合";
	    		dataArr[3].positions2016_txt="都不符合";
	    		dataArr[3].positions2017_txt="都不符合";
	    		
	    		
	    		dataArr[4]=new Object();
	    		dataArr[4].company1profit1="0";
	    		dataArr[4].company1profit2="0";
	    		dataArr[4].company1profit3="0";
	    		dataArr[4].company1profit4="0";
	    		dataArr[4].company2profit1="0";
	    		dataArr[4].company2profit2="0";
	    		dataArr[4].company2profit3="0";
	    		dataArr[4].company2profit4="0";


			dataArr[5]=new Object();
			dataArr[5].investlast5have3="否";
			dataArr[5].investlast5have3_txt="否";
			dataArr[5].investlast5have1timeover150w="否";
			dataArr[5].investlast5have1timeover150w_txt="否";
			dataArr[5].investlast5have1timeearn150w="否";
			dataArr[5].investlast5have1timeearn150w_txt="否";
			
			
			dataArr[6]=new Object();
			dataArr[6].property2015="a";
			dataArr[6].property2016="a";
			dataArr[6].property2017="a";
			dataArr[6].propertynow="a";
			
			
			dataArr[7]=new Object();
			dataArr[7].house="0";
			dataArr[7].company="0";
			
			
			dataArr[8]=new Object();
	    		dataArr[8].propertycanexplain="是";
	    		dataArr[8].propertycanexplain_txt="是";
	    		dataArr[8].explaininfo="";
	    		
	    		
	    		dataArr[9]=new Object();
	    		dataArr[9].sumproperty2014="a";
			dataArr[9].sumproperty2015="a";
			dataArr[9].sumproperty2016="a";
			dataArr[9].sumproperty2017="a";
			dataArr[9].sumpropertynow="a";
			
			
			dataArr[10]=new Object();
	    		dataArr[10].businessprove="c";
	    		dataArr[10].businessprove_txt="不能提供";
	    		
	    		
	    		dataArr[11]=new Object();
	    		dataArr[11].investprove="c";
	    		dataArr[11].investprove_txt="不能证明";

			
			dataArr[12]=new Object();
	    		dataArr[12].patentused="否";
	    		dataArr[12].patentused_txt="否";
	    		dataArr[12].patentinfo="";
	    		
	    		
	    		dataArr[13]=new Object();
	    		dataArr[13].chopused="否";
	    		dataArr[13].chopused_txt="否";
	    		dataArr[13].chopinfo="";
	    		
	    		
	    		dataArr[14]=new Object();
	    		dataArr[14].havecooperate="否";
	    		dataArr[14].havecooperate_txt="否";
	    		
	    		
	    		dataArr[15]=new Object();
			dataArr[15].companyover5="超过了";
			dataArr[15].companyover5_txt="超过了";
			dataArr[15].companyless5butgood="否";
			dataArr[15].companyless5butgood_txt="否";


			dataArr[16]=new Object();
	    		dataArr[16].getvclast4="否";
	    		dataArr[16].getvclast4_txt="否";
	    		
	    		
	    		dataArr[17]=new Object();
	    		dataArr[17].havedegree="c";
	    		dataArr[17].havedegree_txt="都没有";
	    		
	    		
			dataArr[18]=new Object();
	    		dataArr[18].englishlevel="d";
	    		dataArr[18].englishlevel_txt="都没有";
	    		
	    		dataArr[19]=new Object();
	    		dataArr[19].havelist="b";
	    		dataArr[19].havelist_txt="否";
	    		
	    		dataArr[20]=new Object();
	    		dataArr[20].havenogoodrecord="否";
	    		dataArr[20].havenogoodrecord_txt="否";
	    		
	    		
	    		dataArr[21]=new Object();
	    		dataArr[21].yourfamilybigill="否";
	    		dataArr[21].yourfamilybigill_txt="否";
	    		dataArr[21].yourfamilybigillinfo="";
	    		
	    		
	    		dataArr[22]=new Object();
	    		dataArr[22].havenogoodvisarecord="否";
	    		dataArr[22].havenogoodvisarecord_txt="否";
	    		dataArr[22].havenogoodvisarecordinfo="";
	    		
	    		
	    		dataArr[23]=new Object();
	    		dataArr[23].haveassistant="0";
	    		dataArr[23].haveassistant_txt="没有";
	    		
	    		
	    		dataArr[24]=new Object();
	    		dataArr[24].assistanthaveenglish="0";
	    		dataArr[24].assistanthaveenglish_txt="没有";
	    		
	    		
	    		dataArr[25]=new Object();
	    		dataArr[25].assistantischild="0";
	    		dataArr[25].assistantischild_txt="没有";
	    		
	    		
	    		dataArr[26]=new Object();
	    		dataArr[26].wishlivein="维多利亚";
	    		dataArr[26].wishlivein_txt="维多利亚";
	    		dataArr[26].wishliveininfo="";
	    		
	    		
	    		dataArr[27]=new Object();
	    		dataArr[27].company1export="b";
	    		dataArr[27].company1export_txt="没有出口生意";
	    		
	    		dataArr[27].select_years="";
	    		dataArr[27].company2export="b";
	    		dataArr[27].company2export_txt="没有出口生意";
	    		dataArr[27].select_years2="";
	    		
	    		
	    		dataArr[99]=new Object();
	    		dataArr[99].is188a=false;
	    		dataArr[99].is188b=false;
	    		dataArr[99].is188c=false;
	    		dataArr[99].is132=false;
	    		dataArr[99].isnofit=false;
	    		dataArr[99].ageScore=0;
	    		dataArr[99].englishlevelScore=0;
	    		dataArr[99].degreeScore=0;
	    		dataArr[99].businessproveScore=0;
	    		dataArr[99].investproveScore=0;
	    		dataArr[99].propertyScore=0;
	    		dataArr[99].turnoverScore=0;
	    		dataArr[99].otherScore=0;
	    		
	    		
	    		
			
			queueArr=new Array();
    		}
    		
    		    		
    		
    		doInitVar();
    		changeStyle("bd","bluebody");
    		
    		
    		function firsteval()
    		{
    			debugger;
    			dataArr[99].is188a=false;
	    		dataArr[99].is188b=false;
	    		dataArr[99].is188c=false;
	    		dataArr[99].is132=false;
	    		dataArr[99].isnofit=false;
    			//188a
    			//q11
    			yearsturnoverover500000count=0;
    			q11pass=false;
    			q6pass=false;
    			q19pass=false;
    			dataArr[3].companyturnover1=Number(dataArr[3].company1turnover1)+Number(dataArr[3].company2turnover1);
    			dataArr[3].companyturnover2=Number(dataArr[3].company1turnover2)+Number(dataArr[3].company2turnover2);
    			dataArr[3].companyturnover3=Number(dataArr[3].company1turnover3)+Number(dataArr[3].company2turnover3);
    			dataArr[3].companyturnover4=Number(dataArr[3].company1turnover4)+Number(dataArr[3].company2turnover4);
    			
    			if((dataArr[3].companyturnover1<400000 && dataArr[3].positions2014 !="b")||(dataArr[3].companyturnover1>=400000 && dataArr[3].positions2014 =="c"))
    			{
    				dataArr[3].companyturnover1=0;
    			}
    			if((dataArr[3].companyturnover2<400000 && dataArr[3].positions2015 !="b")||(dataArr[3].companyturnover2>=400000 && dataArr[3].positions2015 =="c"))
    			{
    				dataArr[3].companyturnover2=0;
    			}
    			if((dataArr[3].companyturnover3<400000 && dataArr[3].positions2016 !="b")||(dataArr[3].companyturnover3>=400000 && dataArr[3].positions2016 =="c"))
    			{
    				dataArr[3].companyturnover3=0;
    			}
    			if((dataArr[3].companyturnover4<400000 && dataArr[3].positions2017 !="b")||(dataArr[3].companyturnover4>=400000 && dataArr[3].positions2017 =="c"))
    			{
    				dataArr[3].companyturnover4=0;
    			}
    			
    			var last4_2year_sum_arr=new Array();
    			last4_2year_sum_arr.push(dataArr[3].companyturnover1);
    			last4_2year_sum_arr.push(dataArr[3].companyturnover2);
    			last4_2year_sum_arr.push(dataArr[3].companyturnover3);
    			last4_2year_sum_arr.push(dataArr[3].companyturnover4);
    			var compare = function (x, y) {//比较函数
				    if (x < y) {
				        return -1;
				    } else if (x > y) {
				        return 0;
				    } else {
				        return 0;
				    }
				}
				var sortedarr=last4_2year_sum_arr.sort(compare); //big...small
				//dataArr[3].last4_2year_sum=Number(sortedarr[0])+Number(sortedarr[1]);
				for(i=0;i<sortedarr.length-1;i++)
				{
					if(sortedarr[i]==sortedarr[i-1])
					{
						dataArr[3].last4_2year_sum = sortedarr[i-1];	
						break;	
					}
					else
					{
						dataArr[3].last4_2year_sum = sortedarr[i-1];
					}
				}
				
    			
    			if(Number(dataArr[3].companyturnover1)>=500000)
    			{
    				yearsturnoverover500000count++;
    			}
    			if(Number(dataArr[3].companyturnover2)>=500000)
    			{
    				yearsturnoverover500000count++;
    			}
    			if(Number(dataArr[3].companyturnover3)>=500000)
    			{
    				yearsturnoverover500000count++;
    			}
    			if(Number(dataArr[3].companyturnover4)>=500000)
    			{
    				yearsturnoverover500000count++;
    			}
    			if(yearsturnoverover500000count>=2)
    			{
    				q11pass=true;
    			}
    			if(Number(dataArr[0].age)<55)
    			{
    				q6pass=true;
    			}
    			if(dataArr[6].propertynow!="a")
    			{
    				q19pass=true;
    			}
    			if(q11pass&&q6pass&&q19pass)
    			{
    				//alert("is188a");
    				dataArr[99].is188a=true;
    			}
    			
    			
    			//188b
    			q13pass=false;
    			q16171819pass=false;
    			q14pass=false;
    			
    			//q6 same as before
    			
    			//q13 a
    			if(dataArr[5].investlast5have3=="是")
    			{
    				q13pass=true;
    			}
    			//q16
    			if(dataArr[6].property2015>="f"&&dataArr[6].property2016>="f"&&dataArr[6].property2017>="f"&&dataArr[6].propertynow>="f")
    			{
    				//if()
    				
    				q16171819pass=true;
    			}
    			//q14
    			if(dataArr[5].investlast5have1timeover150w=="是" &&dataArr[5].investlast5have1timeearn150w=="是")
    			{
    				q14pass=true;
    			}
    			if(q13pass&&q6pass&&q16171819pass&&q14pass)
    			{
    				//alert("is188B");
    				dataArr[99].is188b=true;
    			}
    			
    			
    			//188c
    			if(dataArr[6].propertynow>="g")
    			{
    				//alert("is188c");
    				dataArr[99].is188c=true;
    			}
    			
    			
    			//132
    			q19pass=false;
    			q11pass=false;
    			q2428pass=false;
    			yearsturnoverover3000000count=0;
    			
    			//q19
    			if(dataArr[6].propertynow>="d")
    			{
    				q19pass=true;
    			}
    			
    			
    			//q11
    			iscompanyturnover1over300w=false;
    			iscompanyturnover2over300w=false;
    			iscompanyturnover3over300w=false;
    			iscompanyturnover4over300w=false;
    			if(Number(dataArr[3].companyturnover1)>=3000000)
    			{
    				yearsturnoverover3000000count++;
    				iscompanyturnover1over300w=true;
    			}
    			if(Number(dataArr[3].companyturnover2)>=3000000)
    			{
    				yearsturnoverover3000000count++;
    				iscompanyturnover2over300w=true;
    			}
    			if(Number(dataArr[3].companyturnover3)>=3000000)
    			{
    				yearsturnoverover3000000count++;
    				iscompanyturnover3over300w=true;
    			}
    			if(Number(dataArr[3].companyturnover4)>=3000000)
    			{
    				yearsturnoverover3000000count++;
    				iscompanyturnover3over300w=true;

    			}
    			if(yearsturnoverover3000000count>=2)
    			{
    				q11pass=true;
    			}
    			
    			//q2428
//  			if(dataArr[9].sumproperty2014!="a" &&dataArr[9].sumproperty2015!="a" &&dataArr[9].sumproperty2016!="a" &&dataArr[9].sumproperty2017!="a" &&dataArr[9].sumpropertynow!="a")
//  			{
//  				if(dataArr[3].companyturnover1>400000&&dataArr[3].companyturnover2>400000&&dataArr[3].companyturnover3>400000&&dataArr[3].companyturnover4>400000)
//  				{
//  					q2428pass=true;
//  				}
//  			}
			//q2428 fit twice;
			q2428fitq11count=0;
			if(iscompanyturnover1over300w && dataArr[9].sumproperty2014!="a")
			{
				q2428fitq11count++;
			}
			if(iscompanyturnover1over300w && dataArr[9].sumproperty2014!="a")
			{
				q2428fitq11count++;
			}
			if(iscompanyturnover1over300w && dataArr[9].sumproperty2014!="a")
			{
				q2428fitq11count++;
			}
			if(iscompanyturnover1over300w && dataArr[9].sumproperty2014!="a")
			{
				q2428fitq11count++;
			}
			if(q2428fitq11count>=2)
			{
				q2428pass=true;
			}
    			
    			if(q19pass&&q6pass&&q11pass&&q2428pass)
    			{
    				//alert("is132");
    				dataArr[99].is132=true;
    			}
    		}
    		
    		function getNextPageIndex(currentPageIndex)
    		{
    			queueArr.push(currentPageIndex);
    			var nextIndex=currentPageIndex+1;
    			switch (currentPageIndex){
    				case 1: //company page1
    					if(dataArr[1].companyname1=="" && dataArr[1].companyname2=="")
    					{
    						nextIndex=5;
    					}
    					break;
//  				case 8: //company page2
//  					if(dataArr[1].companyname1=="" && dataArr[1].companyname2=="")
//  					{
//  						nextIndex=10;
//  					}
//  					break;
					case 9:
						firsteval();
						if(dataArr[99].is188a==false && dataArr[99].is188b==false && dataArr[99].is188c==false && dataArr[99].is132==false)
						{
							dataArr[99].isnofit=true
							nextIndex=28;
						}
						
						
						if(dataArr[99].is188a==true || dataArr[99].is132==true)
						{
							nextIndex=10;
						}
						else if(dataArr[99].is188b==true)
						{
							nextIndex=11;
						}
//						else if(dataArr[99].is132==true)
//						{
//							nextIndex=12;
//						}
						else if(dataArr[99].is188c==true)  //genius~~!!
						{
							nextIndex=18;
						}
						
						break;
					case 10:
						if(dataArr[99].is188b==false)
							nextIndex=12;
						break;
					case 16:
						nextIndex=27;  //add page atention array insert before evalover!! 
						break;
					case 27:
						nextIndex=17; //add page atention
						break;
					case 23:
						if(dataArr[23].haveassistant=="0")
						{
							nextIndex=25;
						}
						break;
					case 26:
						nextIndex=28; //add page atention
						break;
    				default:
    					break;
    			}
    			return nextIndex;
    		}
    		
    		function getPrevPageIndex(currentPageIndex)
    		{
    			return queueArr.pop();
    		}
    		
    		function controlPageToggle(modalSelect, modalDataArray, currentPageIndex, direction) {
		    var arrayLength = modalDataArray.length;
		    if (arrayLength <= 1)
		        return;
		
		    if (direction == 1) {
		    		nextIndex=getNextPageIndex(currentPageIndex);
		        //如果当前页是倒数第二页，则将下一页设置为尾页
		        if (nextIndex == arrayLength - 1) {
		            $(modalSelect + " " + ".next-page").text("提交");
		        }
		
		        //如果当前页是首页，添加上一页
		        if (currentPageIndex == 0 && arrayLength > 1) {
		            $(modalSelect + " " + ".previous-page").removeClass("hidden");
		        }
		        
		        //更换modal-body和页码
		        $(modalSelect + " " + ".page-index").text(nextIndex.toString());
		        $(modalSelect + " " + ".modal-body").html(getUrlContent(modalDataArray[nextIndex]));
		    }
		    else {
		    		prevIndex=getPrevPageIndex(currentPageIndex);
		        //如果当前页是尾页
		        if (currentPageIndex == arrayLength - 1) {
		            $(modalSelect + " " + ".next-page").text("下一页");
		        }
		
		        //如果当前页是正数第二页,则将上一页设置为首页
		        if (prevIndex == 0) {
		            $(modalSelect + " " + ".previous-page").addClass("hidden");
		        }
		        //更换modal-body和页码
		        $(modalSelect + " " + ".page-index").text(prevIndex.toString());
		        $(modalSelect + " " + ".modal-body").html(getUrlContent(modalDataArray[prevIndex]));
		    }
		
		}
		
		function inputvalueCheck(pagenum)
		{
			var returnVL=true;
			switch (pagenum){
				case 0:
					if($("#customername").val()=="")
					{
						bootbox.alert("请输入客户名字");
						returnVL=false;
					}
					break;
				case 24:
					var assistantenglishnoreachnum=$('input[type=radio][name=assistanthaveenglish]:checked').val();
					//alert(assistantenglishnoreachnum)
					if(assistantenglishnoreachnum>dataArr[23].haveassistant)
					{
						bootbox.alert("您并没有"+assistantenglishnoreachnum+"位18岁以上副申请人！");
						returnVL=false;
					}
					break;
				default:
					break;
			}
			return returnVL;
		}
		
		/**
		 *
		 * @param modalSelect modal选择符
		 * @param modalDataArray html代码字符串数组
		 * @param modalCallback modal回调函数
		 */
		function moadlDataControl(modalSelect, modalDataArray, modalCallback) {
		    //初始化模态框首页数据
		    //$(modalSelect + " " + ".modal-body").html(modalDataArray[0]);
		    $(modalSelect + " " + ".modal-body").html(getUrlContent(modalDataArray[0]));
		    if (modalDataArray.length <= 1) {
		        $(modalSelect + " " + ".next-page").text("提交");
		    }
		
		    //点击下一页
		    $(modalSelect + " " + ".next-page").click(function () {
		        
		        if ($(this).text() == "提交") {
		            $(modalSelect).modal('hide');
		            doInitVar();
		            return;
		        }
		        //获取当前页码
		        var currentPageIndex = parseInt($(modalSelect + " " + ".page-index").text());
		        if(!inputvalueCheck(currentPageIndex))return;
		        //调用回调函数
		        modalCallback(currentPageIndex);
		        //alert(currentPageIndex);
		        controlPageToggle(modalSelect, modalDataArray, currentPageIndex, 1);
		    });
		
		    //点击上一页
		    $(modalSelect + " " + ".previous-page").click(function () {
		    		
		        //获取当前页码
		        var currentPageIndex = parseInt($(modalSelect + " " + ".page-index").text());
		        modalCallback(currentPageIndex);
		        controlPageToggle(modalSelect, modalDataArray, currentPageIndex, -1);
		    });
		
		    //关闭模态框时，重置为首页
		    $(modalSelect).on('hidden.bs.modal', function () {
		        $(modalSelect + " " + ".page-index").text((0).toString());
		        if (modalDataArray.length <= 1) {
		            $(modalSelect + " " + ".next-page").text("提交");
		        }
		        else {
		            $(modalSelect + " " + ".next-page").text("下一页");
		        }
		        $(modalSelect + " " + ".modal-body").html(getUrlContent(modalDataArray[0]));
		        $(modalSelect + " " + ".previous-page").addClass("hidden");
		    })
		}

		function calcAge(inputDMY)
		{
			//alert(inputDMY)
			var inputDate=new Date();
			var arrDMY=inputDMY.split("/");
			inputDate.setFullYear(arrDMY[2],arrDMY[1],arrDMY[0]);
			var today=new Date();
			//alert(today.getTime()-inputDate.getTime());
			return 99;
		}
		
		function jsGetAge(inputDMY){         
		    var returnAge;  
		    var strBirthdayArr=inputDMY.split("/");
		    var birthYear = strBirthdayArr[2];  
		    var birthMonth = strBirthdayArr[1];  
		    var birthDay = strBirthdayArr[0];  
		      
		    d = new Date();  
		    var nowYear = d.getFullYear();  
		    var nowMonth = d.getMonth() + 1;  
		    var nowDay = d.getDate();  
		      
		    if(nowYear == birthYear){  
		        returnAge = 0;//同年 则为0岁  
		    }  
		    else{  
		        var ageDiff = nowYear - birthYear ; //年之差  
		        if(ageDiff > 0){  
		            if(nowMonth == birthMonth) {  
		                var dayDiff = nowDay - birthDay;//日之差  
		                if(dayDiff < 0)  
		                {  
		                    returnAge = ageDiff - 1;  
		                }  
		                else  
		                {  
		                    returnAge = ageDiff ;  
		                }  
		            }  
		            else  
		            {  
		                var monthDiff = nowMonth - birthMonth;//月之差  
		                if(monthDiff < 0)  
		                {  
		                    returnAge = ageDiff - 1;  
		                }  
		                else  
		                {  
		                    returnAge = ageDiff ;  
		                }  
		            }  
		        }  
		        else  
		        {  
		            returnAge = -1;//返回-1 表示出生日期输入错误 晚于今天  
		        }  
		    }  
		      
		    return returnAge;//返回周岁年龄  
		      
		}  

		function getScore()
		{
			dataArr[99].totalscore=0;
			dataArr[99].ageScore=0;
			if(dataArr[0].age>=18 && dataArr[0].age<=24)
			{
				dataArr[99].ageScore=20;
			}
			else if(dataArr[0].age>=25 && dataArr[0].age<=32)
			{
				dataArr[99].ageScore=30;
			}
			else if(dataArr[0].age>=33 && dataArr[0].age<=39)
			{
				dataArr[99].ageScore=25;
			}
			else if(dataArr[0].age>=40 && dataArr[0].age<=44)
			{
				dataArr[99].ageScore=20;
			}
			else if(dataArr[0].age>=45 && dataArr[0].age<=54)
			{
				dataArr[99].ageScore=15;
			}
			dataArr[99].totalscore+=dataArr[99].ageScore;
			
			//englistlevel
			dataArr[99].englishlevelScore=0;
			if(dataArr[18].englishlevel=="b")
			{
				dataArr[99].englishlevelScore=5;
			}
			else if(dataArr[18].englishlevel=="c")
			{
				dataArr[99].englishlevelScore=10;
			}
			dataArr[99].totalscore+=dataArr[99].englishlevelScore;
			
			
			//degree
			dataArr[99].degreeScore=0;
			if(dataArr[17].havedegree=="a")
			{
				dataArr[99].degreeScore=5;
			}
			else if(dataArr[17].havedegree=="b")
			{
				dataArr[99].degreeScore=10;
			}
			dataArr[99].totalscore+=dataArr[99].degreeScore;
			
			
			//ti ming
			dataArr[99].businessproveScore=0;
			if(dataArr[10].businessprove="a")
			{
				dataArr[99].businessproveScore=10;
			}
			else if(dataArr[10].businessprove="b")
			{
				dataArr[99].businessproveScore=15;
			}
			dataArr[99].totalscore+=dataArr[99].businessproveScore;
			
			
			//investprove
			dataArr[99].investproveScore=0;
			if(dataArr[11].investprove=="a")
			{
				dataArr[99].investproveScore=10;
			}
			else if(dataArr[11].investprove=="b")
			{
				dataArr[99].investproveScore=15;
			}
			dataArr[99].totalscore+=dataArr[99].investproveScore;
			
			//property
			dataArr[99].propertyScore=0;
			dataArr[99].propertyScore_reporttxt="-";
			if(dataArr[6].property2015>="b"&&dataArr[6].property2016>="b"&&dataArr[6].property2017>="b"&&dataArr[6].propertynow>="b")
			{
				dataArr[99].propertyScore=5;
				dataArr[99].propertyScore_reporttxt="80万";
			}
			if(dataArr[6].property2015>="c"&&dataArr[6].property2016>="c"&&dataArr[6].property2017>="c"&&dataArr[6].propertynow>="c")
			{
				dataArr[99].propertyScore=15;
				dataArr[99].propertyScore_reporttxt="130万";
			}
			if(dataArr[6].property2015>="e"&&dataArr[6].property2016>="e"&&dataArr[6].property2017>="e"&&dataArr[6].propertynow>="e")
			{
				dataArr[99].propertyScore=25;
				dataArr[99].propertyScore_reporttxt="180万";
			}
			if(dataArr[6].property2015>="f"&&dataArr[6].property2016>="f"&&dataArr[6].property2017>="f"&&dataArr[6].propertynow>="f")
			{
				dataArr[99].propertyScore=35;
				dataArr[99].propertyScore_reporttxt="225万";
			}
			dataArr[99].totalscore+=dataArr[99].propertyScore;
			
			//turnover
			dataArr[99].turnoverScore=0;
			dataArr[99].turnoverScore_reporttxt="-";
			if(Number(dataArr[3].last4_2year_sum)>=2000000)
			{
				dataArr[99].turnoverScore=35
				dataArr[99].turnoverScore_reporttxt="200万"
			}
			else if(Number(dataArr[3].last4_2year_sum)>=1500000)
			{
				dataArr[99].turnoverScore=25
				dataArr[99].turnoverScore_reporttxt="150万"
			}
			else if(Number(dataArr[3].last4_2year_sum)>=1000000)
			{
				dataArr[99].turnoverScore=15
				dataArr[99].turnoverScore_reporttxt="100万"
			}
			else if(Number(dataArr[3].last4_2year_sum)>=500000)
			{
				dataArr[99].turnoverScore=5
				dataArr[99].turnoverScore_reporttxt="50万"
			}
			dataArr[99].totalscore+=dataArr[99].turnoverScore;
			
//			dataArr[99].turnoverScore=0;
//			yearsturnoverover500000count=0;
//			yearsturnoverover1000000count=0;
//			yearsturnoverover1500000count=0;
//			yearsturnoverover2000000count=0;
//			
//			if(Number(dataArr[3].companyturnover1)>500000)
//			{
//				yearsturnoverover500000count++;
//			}
//			if(Number(dataArr[3].companyturnover2)>500000)
//			{
//				yearsturnoverover500000count++;
//			}
//			if(Number(dataArr[3].companyturnover3)>500000)
//			{
//				yearsturnoverover500000count++;
//			}
//			if(Number(dataArr[3].companyturnover4)>500000)
//			{
//				yearsturnoverover500000count++;
//			}
//			if(yearsturnoverover500000count>=2)
//			{
//				dataArr[99].turnoverScore=5
//			}
//			
//			if(Number(dataArr[3].companyturnover1)>1000000)
//			{
//				yearsturnoverover1000000count++;
//			}
//			if(Number(dataArr[3].companyturnover2)>1000000)
//			{
//				yearsturnoverover1000000count++;
//			}
//			if(Number(dataArr[3].companyturnover3)>1000000)
//			{
//				yearsturnoverover1000000count++;
//			}
//			if(Number(dataArr[3].companyturnover4)>1000000)
//			{
//				yearsturnoverover1000000count++;
//			}
//			if(yearsturnoverover1000000count>=2)
//			{
//				dataArr[99].turnoverScore=15
//			}
//			
//			if(Number(dataArr[3].companyturnover1)>1500000)
//			{
//				yearsturnoverover1500000count++;
//			}
//			if(Number(dataArr[3].companyturnover2)>1500000)
//			{
//				yearsturnoverover1500000count++;
//			}
//			if(Number(dataArr[3].companyturnover13)>1500000)
//			{
//				yearsturnoverover1500000count++;
//			}
//			if(Number(dataArr[3].companyturnover4)>1500000)
//			{
//				yearsturnoverover1500000count++;
//			}
//			if(yearsturnoverover1500000count>=2)
//			{
//				dataArr[99].turnoverScore=25
//			}
//			
//			if(Number(dataArr[3].companyturnover1)>2000000)
//			{
//				yearsturnoverover2000000count++;
//			}
//			if(Number(dataArr[3].companyturnover2)>2000000)
//			{
//				yearsturnoverover2000000count++;
//			}
//			if(Number(dataArr[3].companyturnover3)>2000000)
//			{
//				yearsturnoverover2000000count++;
//			}
//			if(Number(dataArr[3].companyturnover4)>2000000)
//			{
//				yearsturnoverover2000000count++;
//			}
//			if(yearsturnoverover2000000count>=2)
//			{
//				dataArr[99].turnoverScore=35
//			}
//			dataArr[99].totalscore+=dataArr[99].turnoverScore;
			
			//otherScore
			dataArr[99].otherScore=0;
			dataArr[99].otherScore_patentused=0;
			dataArr[99].otherScore_chopused=0;
			dataArr[99].otherScore_havecooperate=0;
			dataArr[99].otherScore_companyless5butgood=0;
			dataArr[99].otherScore_getvclast4=0;
			dataArr[99].otherScore_exportScore=0;
			
			
			
			if(dataArr[12].patentused =="是")
			{
				dataArr[99].otherScore+=15;
				dataArr[99].otherScore_patentused=15;
			}
			if(dataArr[13].chopused=="是")
			{
				dataArr[99].otherScore+=10;
				dataArr[99].otherScore_chopused=10;
			}
			if(dataArr[14].havecooperate=="是")
			{
				dataArr[99].otherScore+=5;
				dataArr[99].otherScore_havecooperate=5
			}
//			if(dataArr[13].chopused=="是")
//			{
//				otherScore+=10;
//			}
			if(dataArr[15].companyless5butgood=="是")
			{
				dataArr[99].otherScore+=10;
				dataArr[99].otherScore_companyless5butgood=10;
			}
			if(dataArr[16].getvclast4=="是")
			{
				dataArr[99].otherScore+=10;
				dataArr[99].otherScore_getvclast4=10;
			}
			// export score
			arryear1=dataArr[27].select_years
			//arryear2=dataArr[27].select_years2
			if(arryear1=="" || arryear1==undefined)
			{
				dataArr[99].otherScore+=0;
			}
			else if(arryear1.length>=2 )
			{
				dataArr[99].otherScore+=15;
				dataArr[99].otherScore_exportScore=15;
			}
			//dataArr[99].totalscore+=dataArr[99].exportScore;
			
			
			dataArr[99].totalscore+=dataArr[99].otherScore;
			
			
			
			
			// by Totalscore , change 188a 188b 188c 132 
			var tscore=dataArr[99].totalscore;
			if(tscore <=65)
			{
				dataArr[99].is188a=false;
				dataArr[99].is188b=false;
			}
			
			// kui sui 
			dataArr[99].iskuisui=0;
			if(dataArr[4].company1profit1<0 ||dataArr[4].company1profit2<0 ||dataArr[4].company1profit3<0 ||dataArr[4].company1profit4<0||dataArr[21].yourfamilybigill=="是"||dataArr[20].havenogoodrecord=="是")
			{
				dataArr[99].iskuisui=1;
			}	
		}

		function modalCallback(currentPageIndex) {
		    //alert("调用回调函数");
		    
		    for(key in dataArr[currentPageIndex] )
            {
            	
            		dataArr[currentPageIndex][key] = $("#"+key).val();

            }
		    
		    switch (currentPageIndex){
		    	case 0:
		    		//dataArr[0].customername=$("#customername").val();
		    		//dataArr[0].brithday=$("#brithday").val();
		    		dataArr[0].age=jsGetAge($("#brithday").val());
		    		
		    		break;
		    	case 2:
		    		//alert($('input[type=radio][name=spousechangeproportion]:checked').val());
		    		debugger;
		    		dataArr[2].spousechangeproportion=$('input[type=radio][name=spousechangeproportion]:checked').val();
		    		dataArr[2].spousechangeproportion_txt=$('input[type=radio][name=spousechangeproportion]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		    	case 3:
		    		dataArr[3].positions2014_txt=$("#positions2014").find("option:selected").text();
					dataArr[3].positions2015_txt=$("#positions2015").find("option:selected").text();
					dataArr[3].positions2016_txt=$("#positions2016").find("option:selected").text();
					dataArr[3].positions2017_txt=$("#positions2017").find("option:selected").text();
		    		break;
		    	case 5:
		    		dataArr[5].investlast5have3=$('input[type=radio][name=investlast5have3]:checked').val();
		    		dataArr[5].investlast5have3_txt=$('input[type=radio][name=investlast5have3]:checked')[0].nextSibling.nodeValue.trim();
	
		    		dataArr[5].investlast5have1timeover150w=$('input[type=radio][name=investlast5have1timeover150w]:checked').val();
		    		dataArr[5].investlast5have1timeover150w_txt=$('input[type=radio][name=investlast5have1timeover150w]:checked')[0].nextSibling.nodeValue.trim();
		    		
		    		dataArr[5].investlast5have1timeearn150w=$('input[type=radio][name=investlast5have1timeearn150w]:checked').val();
		    		dataArr[5].investlast5have1timeearn150w_txt=$('input[type=radio][name=investlast5have1timeearn150w]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		    	case 6:
		    		dataArr[6].property2015_txt=$("#property2015").find("option:selected").text();
					dataArr[6].property2016_txt=$("#property2016").find("option:selected").text();
					dataArr[6].property2017_txt=$("#property2017").find("option:selected").text();
					dataArr[6].propertynow_txt=$("#propertynow").find("option:selected").text();
		    		break;
		    	case 8:
		    		//alert($('input[type=radio][name=spousechangeproportion]:checked').val());
		    		dataArr[8].propertycanexplain=$('input[type=radio][name=propertycanexplain]:checked').val();
		    		dataArr[8].propertycanexplain_txt=$('input[type=radio][name=propertycanexplain]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		    	case 9:
		    		dataArr[9].sumproperty2014_txt=$("#sumproperty2014").find("option:selected").text();
		    		dataArr[9].sumproperty2015_txt=$("#sumproperty2015").find("option:selected").text();
		    		dataArr[9].sumproperty2016_txt=$("#sumproperty2016").find("option:selected").text();
		    		dataArr[9].sumproperty2017_txt=$("#sumproperty2017").find("option:selected").text();
		    		dataArr[9].sumpropertynow_txt=$("#sumpropertynow").find("option:selected").text();
		    		break;
		    	case 10:
		    		//alert($('input[type=radio][name=spousechangeproportion]:checked').val());
		    		dataArr[10].businessprove=$('input[type=radio][name=businessprove]:checked').val();
		    		dataArr[10].businessprove_txt=$('input[type=radio][name=businessprove]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
			case 11:
		    		//alert($('input[type=radio][name=spousechangeproportion]:checked').val());
		    		dataArr[11].investprove=$('input[type=radio][name=investprove]:checked').val();
		    		dataArr[11].investprove_txt=$('input[type=radio][name=investprove]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		    	case 12:
		    		
		    		dataArr[12].patentused=$('input[type=radio][name=patentused]:checked').val();
		    		dataArr[12].patentused_txt=$('input[type=radio][name=patentused]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		    	case 13:
		    		
		    		dataArr[13].chopused=$('input[type=radio][name=chopused]:checked').val();
		    		dataArr[13].chopused_txt=$('input[type=radio][name=chopused]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
			case 14:
		    		
		    		dataArr[14].havecooperate=$('input[type=radio][name=havecooperate]:checked').val();
		    		dataArr[14].havecooperate_txt=$('input[type=radio][name=havecooperate]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		    	case 15:
		    		dataArr[15].companyover5=$('input[type=radio][name=companyover5]:checked').val();	
		    		dataArr[15].companyover5_txt=$('input[type=radio][name=companyover5]:checked')[0].nextSibling.nodeValue.trim();
		    		dataArr[15].companyless5butgood=$('input[type=radio][name=companyless5butgood]:checked').val();	
		    		dataArr[15].companyless5butgood_txt=$('input[type=radio][name=companyless5butgood]:checked')[0].nextSibling.nodeValue.trim();	
		    		break;
		   case 16:
		    		
		    		dataArr[16].getvclast4=$('input[type=radio][name=getvclast4]:checked').val();
		    		dataArr[16].getvclast4_txt=$('input[type=radio][name=getvclast4]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		   case 17:
		    		dataArr[17].havedegree=$('input[type=radio][name=havedegree]:checked').val();
		    		dataArr[17].havedegree_txt=$('input[type=radio][name=havedegree]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		   case 18:
		    		dataArr[18].englishlevel=$('input[type=radio][name=englishlevel]:checked').val();
		    		dataArr[18].englishlevel_txt=$('input[type=radio][name=englishlevel]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		   case 19:
		    		dataArr[19].havelist=$('input[type=radio][name=havelist]:checked').val();
		    		dataArr[19].havelist_txt=$('input[type=radio][name=havelist]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		   case 20:
		    		dataArr[20].havenogoodrecord=$('input[type=radio][name=havenogoodrecord]:checked').val();
		    		dataArr[20].havenogoodrecord_txt=$('input[type=radio][name=havenogoodrecord]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		   case 21:
		    		dataArr[21].yourfamilybigill=$('input[type=radio][name=yourfamilybigill]:checked').val();
		    		dataArr[21].yourfamilybigill_txt=$('input[type=radio][name=yourfamilybigill]:checked')[0].nextSibling.nodeValue.trim();
		    		break;	
		   case 22:
		    		dataArr[22].havenogoodvisarecord=$('input[type=radio][name=havenogoodvisarecord]:checked').val();
		    		dataArr[22].havenogoodvisarecord_txt=$('input[type=radio][name=havenogoodvisarecord]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		   case 23:
		    		dataArr[23].haveassistant=$('input[type=radio][name=haveassistant]:checked').val();
		    		dataArr[23].haveassistant_txt=$('input[type=radio][name=haveassistant]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		   case 24:
		    		dataArr[24].assistanthaveenglish=$('input[type=radio][name=assistanthaveenglish]:checked').val();
		    		dataArr[24].assistanthaveenglish_txt=$('input[type=radio][name=assistanthaveenglish]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		   case 25:
		    		dataArr[25].assistantischild=$('input[type=radio][name=assistantischild]:checked').val();
		    		dataArr[25].assistantischild_txt=$('input[type=radio][name=assistantischild]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		   case 26:
		    		dataArr[26].wishlivein=$('input[type=radio][name=wishlivein]:checked').val();
		    		dataArr[26].wishlivein_txt=$('input[type=radio][name=wishlivein]:checked')[0].nextSibling.nodeValue.trim();
		    		getScore();
		    		break;
		    	case 27:
		    		dataArr[27].company1export=$('input[type=radio][name=company1export]:checked').val();
		    		dataArr[27].company1export_txt=$('input[type=radio][name=company1export]:checked')[0].nextSibling.nodeValue.trim();
		    		//dataArr[27].company2export=$('input[type=radio][name=company2export]:checked').val();
		    		//dataArr[27].company2export_txt=$('input[type=radio][name=company2export]:checked')[0].nextSibling.nodeValue.trim();
		    		break;
		    	default:
		    		break;
		    }
		    
		}
		
		function doSomeExt(currentPageIndex)
		{
			switch (currentPageIndex){
		    	case 0:
		    		
		    		$("#brithday").datepicker('setDate',$("#brithday").val());
		    		
		    		break;
		    	case 1:
		    		$("#establishtime1").datepicker('setDate',$("#establishtime1").val());
		    		$("#establishtime2").datepicker('setDate',$("#establishtime2").val());
		    		break;
		    	case 2:
		    		//alert(dataArr[2].spousechangeproportion);
		    		//$('input[type=radio][name=spousechangeproportion][value="'+dataArr[2].spousechangeproportion+'"]').prop("checked",'checked');
		    		$('input[type=radio][name=spousechangeproportion][value="'+dataArr[2].spousechangeproportion+'"]').click();
		    		break;
		    	case 3:
		    		$("#companyname1").html(dataArr[1].companyname1);
		    		
		    		if(dataArr[1].companyname2!="")
		    		{
		    			$("#companyname2").html(dataArr[1].companyname2);
		    			$("#companyname2turnovertable").show();
		    		}
		    		else
		    		{
		    			$("#companyname2turnovertable").hide();
		    		}
		    		
		    		break;
		    	case 4:
		    		$("#companyname1").html(dataArr[1].companyname1);
		    		
		    		if(dataArr[1].companyname2!="")
		    		{
		    			$("#companyname2").html(dataArr[1].companyname2);
		    			$("#companyname2profittable").show();
		    		}
		    		else
		    		{
		    			$("#companyname2profittable").hide();
		    		}
		    		
		    		break;
		    	case 5:
		    		$('input[type=radio][name=investlast5have3][value="'+dataArr[5].investlast5have3+'"]').click();
		    		$('input[type=radio][name=investlast5have1timeover150w][value="'+dataArr[5].investlast5have1timeover150w+'"]').click();
		    		$('input[type=radio][name=investlast5have1timeearn150w][value="'+dataArr[5].investlast5have1timeearn150w+'"]').click();
		    		break;
		    	case 8:
		    		$('input[type=radio][name=propertycanexplain][value="'+dataArr[8].propertycanexplain+'"]').click();
		    		break;
		    	case 9:
		    		$("#companynameinfo").html(dataArr[1].companyname1);
		    		
		    		if(dataArr[1].companyname2!="")
		    		{
		    			$("#companynameinfo").html(dataArr[1].companyname1+"和"+dataArr[1].companyname2+"加起来");
		    		
		    		}
		    		
		    		
		    		break;
		    	case 10:
		    		$('input[type=radio][name=businessprove][value="'+dataArr[10].businessprove+'"]').click();
		    		break;
		    	case 11:
		    		$('input[type=radio][name=investprove][value="'+dataArr[11].investprove+'"]').click();
		    		break;
		    	case 12:
		    		
		    		$('input[type=radio][name=patentused][value="'+dataArr[12].patentused+'"]').click();
		    		break;
		    	case 13:
		    		
		    		$('input[type=radio][name=chopused][value="'+dataArr[13].chopused+'"]').click();
		    		break;
		   case 14:
		    		$('input[type=radio][name=havecooperate][value="'+dataArr[14].havecooperate+'"]').click();
		    		break;
		   	case 15:
		    		$('input[type=radio][name=companyover5][value="'+dataArr[15].companyover5+'"]').click();
		    		$('input[type=radio][name=companyless5butgood][value="'+dataArr[15].companyless5butgood+'"]').click();
		    		break;
		   case 16:
		    		$('input[type=radio][name=getvclast4][value="'+dataArr[16].getvclast4+'"]').click();
		    		break;
		   case 17:
		    		$('input[type=radio][name=havedegree][value="'+dataArr[17].havedegree+'"]').click();
		    		break;
		   case 18:
		    		$('input[type=radio][name=englishlevel][value="'+dataArr[18].englishlevel+'"]').click();
		    		break;
		   case 19:
		    		$('input[type=radio][name=havelist][value="'+dataArr[19].havelist+'"]').click();
		    		break;
		  case 20:
		    		$('input[type=radio][name=havenogoodrecord][value="'+dataArr[20].havenogoodrecord+'"]').click();
		    		break;
		 case 21:
		    		$('input[type=radio][name=yourfamilybigill][value="'+dataArr[21].yourfamilybigill+'"]').click();
		    		break;
		case 22:
		    		$('input[type=radio][name=havenogoodvisarecord][value="'+dataArr[22].havenogoodvisarecord+'"]').click();
		    		break;
	  	case 23:
		    		$('input[type=radio][name=haveassistant][value="'+dataArr[23].haveassistant+'"]').click();
		    		break;
		case 24:
		    		$('input[type=radio][name=assistanthaveenglish][value="'+dataArr[24].assistanthaveenglish+'"]').click();
		    		break;
		 case 25:
		    		$('input[type=radio][name=assistantischild][value="'+dataArr[25].assistantischild+'"]').click();
		    		break;
		 case 26:
		    		$('input[type=radio][name=wishlivein][value="'+dataArr[26].wishlivein+'"]').click();
		    		break;
		case 27:
		    		$('input[type=radio][name=company1export][value="'+dataArr[27].company1export+'"]').click();
		    		//$('input[type=radio][name=company2export][value="'+dataArr[27].company2export+'"]').click();
		    		if(dataArr[1].companyname1!="")
		    		{
		    			$("#companyname1").html(dataArr[1].companyname1);
		    		}
		    		break;
		    	default:
		    		break;
		    }
		}
		
		function getUrlContent(url)
		{
			//$("#button3_group").hide();
			$("#ppage").button('loading');
			$("#npage").button('loading');
			$.ajax({
                    url:url,
                    type:'POST', //GET
                    async:true,    //或false,是否异步
                    data:{
                        //id:seid
                    },
                    timeout:5000,    //超时时间
                    dataType:'html',    //返回的数据格式：json/xml/html/script/jsonp/text
                    beforeSend:function(xhr){
                        console.log(xhr)
                        console.log('发送前')
                        //showLoading("加载中...")
                    },
                    success:function(data,textStatus,jqXHR){
                   	 	//hideLoading();
                   	 	$("#ppage").button('reset');
						$("#npage").button('reset');
                        $("#myModal .modal-body").html(data);
                        var currentPageIndex = parseInt($("#myModal .page-index").text());
                        for(key in dataArr[currentPageIndex] )
                        {
                        		//alert(key+" "+dataArr[currentPageIndex][key]);
                        		$("#"+key).val(dataArr[currentPageIndex][key]);
                        }
                        doSomeExt(currentPageIndex);
                    },
                    error:function(xhr,textStatus){
                    		//hideLoading();
                    		$("#ppage").button('reset');
						$("#npage").button('reset');
                        bootbox.alert("网络错误,请重试！");
                        console.log(xhr)
                        console.log(textStatus)
                    },
                    complete:function(){
                    		//hideLoading();
                    		//$("#button3_group").show();
                    		$("#ppage").button('reset');
						$("#npage").button('reset');
                        console.log('结束')
                    }
                });
		}
		
		$(function () {
//			$('#myModal').modal({
//			keyboard: false
//			})
		    //定义模态框数据
		    var modalDataArray = new Array("question/v10/q1.php","question/v10/q2.php","question/v10/q3.php","question/v10/q4.php","question/v10/q5.php","question/v10/q6.php","question/v10/q7.php","question/v10/q8.php","question/v10/q9.php","question/v10/q10.php","question/v10/q11.php","question/v10/q12.php","question/v10/q13.php","question/v10/q14.php","question/v10/q15.php","question/v10/q16.php","question/v10/q17.php","question/v10/q18.php","question/v10/q19.php","question/v10/q20.php","question/v10/q21.php","question/v10/q22.php","question/v10/q23.php","question/v10/q24.php","question/v10/q25.php","question/v10/q26.php","question/v10/q27.php","question/v10/q17.1.php","question/v10/evalover.php");
		    //modalDataArray[101]="question/v10/q17.1.php";
		    //modalDataArray[102]="";
		    moadlDataControl("#myModal", modalDataArray, modalCallback);
		});
		
			
	function initLoading(){
	    $("body").append("<!-- loading -->" +
	            "<div class='modal fade' id='loading' tabindex='99' role='dialog' aria-labelledby='myModalLabel' data-backdrop='static'>" +
	            "<div class='modal-dialog' role='document'>" +
	            "<div class='modal-content'>" +
	            "<div class='modal-header'>" +
	            "<h4 class='modal-title' id='myModalLabel'>提示</h4>" +
	            "</div>" +
	            "<div id='loadingText' class='modal-body'>" +
	            "<span class='glyphicon glyphicon-refresh' aria-hidden='true'>1</span>" +
	            "处理中，请稍候。。。" +
	            "</div>" +
	            "</div>" +
	            "</div>" +
	            "</div>"
	    );
	}
	function showLoading(text){
	    $("#loadingText").html(text);
	    $("#loading").modal("show");
	}
	function hideLoading(){
	    $("#loading").modal("hide");
	}
	
	//alert(JSON.stringify(dataArr));
	initLoading();

		
		function gotomain()
		{
			inputpwdtogo(<?echo $_COOKIE['userid'];?>,"main.php")
		}
    </script>
  </body>
</html>
